home *** CD-ROM | disk | FTP | other *** search
- class getURLManager
- {
- var callQueue;
- var processing;
- var freq;
- var me;
- var lastCall;
- function getURLManager(frequency)
- {
- this.callQueue = new Array();
- this.processing = false();
- if(frequency == undefined)
- {
- this.freq = 1000;
- }
- this.me = this;
- }
- function executeCall()
- {
- this.lastCall = getTimer();
- var _loc2_ = this.callQueue.shift();
- if(_loc2_.href.indexOf("javascript") != -1 || _loc2_.win == undefined || _loc2_.win == "" || _loc2_.win == null)
- {
- getURL(_loc2_.href,"");
- }
- else
- {
- getURL(_loc2_.href,_loc2_.win);
- }
- }
- function stopCalling()
- {
- delete this.me.onEnterFrame;
- this.processing = false;
- }
- function startCalling()
- {
- if(!this.processing)
- {
- this.lastCall = getTimer();
- this.me.onEnterFrame = function()
- {
- if(getTimer() - this.lastCall > this.freq)
- {
- this.executeCall();
- }
- if(this.callQueue.length < 1)
- {
- this.me.stopCalling();
- }
- };
- this.processing = true;
- this.executeCall();
- }
- }
- function addToQueue(inURL, inWindow)
- {
- var _loc2_ = {href:inURL,win:inWindow};
- this.callQueue.push(_loc2_);
- this.startCalling(this.callQueue);
- }
- }
-